package launchramp

class CommunityWorks {
    
    String organization
    String firstName
    String lastName
    String email
    String phone
    String address
    String bio
    byte [] image
    
    static hasMany = { jobs: Job }

    static constraints = {
        organization matches: /^[a-z ,.'-]+$/
        firstName matches: /^[a-z ,.'-]+$/
        lastName matches: /^[a-z ,.'-]+$/
        email email: true
        image size: 1..5000000
        phone matches: /^(?:(?:\+?1\s*(?:[.-]\s*)?)?(?:\(\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\s*\)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\s*(?:[.-]\s*)?)?([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\s*(?:[.-]\s*)?([0-9]{4})(?:\s*(?:#|x\.?|ext\.?|extension)\s*(\d+))?$/
    }
}
